#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
    char sub[11], str[1000001];
    // Input
    gets(sub);
    gets(str);
    // Convert to lowcase
    for (int i = 0; sub[i] != '\0'; ++i) {
        if (sub[i] >= 'A' && sub[i] <= 'Z')
            sub[i] += 32;
    }
    for (int i = 0; str[i] != '\0'; ++i) {
        if (str[i] >= 'A' && str[i] <= 'Z')
            str[i] += 32;
    }
    int count = 0, first = -1;
    // Find the substrig in string
    int sublen = strlen(sub);
    int stlen = strlen(str);
    int into;

    for (int i = 0; i <= stlen - sublen; ++i) {
        // Avoid different characters
        if (sub[0] != str[i])
            continue;
        // Avoid there is a non-white characters before str[i]
        if (i != 0 && str[i - 1] != ' ')
            continue;
        // Avoid ther is a non-white character at sub[i+sublen]
        if (str[i + sublen] != ' ' && str[i + sublen] != '\0')
            continue;
        int flag = true;
        // Loop to judge each characters
        for (int j = i + 1, k = 1; k < sublen; k++, j++) {
            if (sub[k] != str[j]) {
                flag = false;
                break;
            }
        }

        // Update
        if (flag) {
            count++;
            if (count == 1)
                first = i;
        }
    }

    // Output according the count
    if (count) {
        printf("%d %d\n", count, first);
    } else {
        printf("-1\n");
    }

    return 0;
}
